package edu.unf.cen6940.web;

import org.junit.Test;

import org.junit.runner.RunWith;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;

import org.springframework.context.ApplicationContext;

import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;

import org.springframework.test.context.ContextConfiguration;

import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.RequestScope;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.context.request.SessionScope;

/**
 * Unit test for the <code>CategoryController</code> controller.
 *
 * @see edu.unf.cen6940.web.CategoryController
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {
		"file:./resources/rms_test-security-context.xml",
		"file:./resources/rms_test-service-context.xml",
		"file:./resources/rms_test-dao-context.xml",
		"file:./resources/rms_test-web-context.xml" })
public class CategoryControllerTest {
	/**
	 * The Spring application context.
	 *
	 */
	private ApplicationContext context;

	/**
	 * Test <code>editCategoryThesises()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GeteditCategoryThesises() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/editCategoryThesises");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CategoryController controller = (CategoryController) context.getBean("CategoryController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>newCategoryThesises()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetnewCategoryThesises() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/newCategoryThesises");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CategoryController controller = (CategoryController) context.getBean("CategoryController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>saveCategoryThesises()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetsaveCategoryThesises() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/saveCategoryThesises");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CategoryController controller = (CategoryController) context.getBean("CategoryController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>confirmDeleteCategoryThesises()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetconfirmDeleteCategoryThesises() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/confirmDeleteCategoryThesises");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CategoryController controller = (CategoryController) context.getBean("CategoryController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>deleteCategoryThesises()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetdeleteCategoryThesises() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/deleteCategoryThesises");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CategoryController controller = (CategoryController) context.getBean("CategoryController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>selectCategoryThesises()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetselectCategoryThesises() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/selectCategoryThesises");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CategoryController controller = (CategoryController) context.getBean("CategoryController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>listCategoryThesises()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetlistCategoryThesises() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/listCategoryThesises");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CategoryController controller = (CategoryController) context.getBean("CategoryController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>editCategoryFacultyresearchs()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GeteditCategoryFacultyresearchs() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/editCategoryFacultyresearchs");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CategoryController controller = (CategoryController) context.getBean("CategoryController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>newCategoryFacultyresearchs()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetnewCategoryFacultyresearchs() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/newCategoryFacultyresearchs");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CategoryController controller = (CategoryController) context.getBean("CategoryController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>saveCategoryFacultyresearchs()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetsaveCategoryFacultyresearchs() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/saveCategoryFacultyresearchs");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CategoryController controller = (CategoryController) context.getBean("CategoryController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>confirmDeleteCategoryFacultyresearchs()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetconfirmDeleteCategoryFacultyresearchs() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/confirmDeleteCategoryFacultyresearchs");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CategoryController controller = (CategoryController) context.getBean("CategoryController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>deleteCategoryFacultyresearchs()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetdeleteCategoryFacultyresearchs() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/deleteCategoryFacultyresearchs");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CategoryController controller = (CategoryController) context.getBean("CategoryController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>selectCategoryFacultyresearchs()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetselectCategoryFacultyresearchs() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/selectCategoryFacultyresearchs");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CategoryController controller = (CategoryController) context.getBean("CategoryController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>listCategoryFacultyresearchs()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetlistCategoryFacultyresearchs() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/listCategoryFacultyresearchs");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CategoryController controller = (CategoryController) context.getBean("CategoryController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>indexCategory()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetindexCategory() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/indexCategory");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CategoryController controller = (CategoryController) context.getBean("CategoryController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>selectCategory()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetselectCategory() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/selectCategory");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CategoryController controller = (CategoryController) context.getBean("CategoryController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>editCategory()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GeteditCategory() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/editCategory");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CategoryController controller = (CategoryController) context.getBean("CategoryController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>saveCategory()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetsaveCategory() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/saveCategory");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CategoryController controller = (CategoryController) context.getBean("CategoryController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>newCategory()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetnewCategory() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/newCategory");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CategoryController controller = (CategoryController) context.getBean("CategoryController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>confirmDeleteCategory()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetconfirmDeleteCategory() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/confirmDeleteCategory");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CategoryController controller = (CategoryController) context.getBean("CategoryController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>deleteCategory()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetdeleteCategory() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/deleteCategory");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CategoryController controller = (CategoryController) context.getBean("CategoryController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>categoryControllerbinaryaction()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetcategoryControllerbinaryaction() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/categoryController/binary.action");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CategoryController controller = (CategoryController) context.getBean("CategoryController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Autowired to set the Spring application context.
	 *
	 */
	@Autowired
	public void setContext(ApplicationContext context) {
		this.context = context;
		((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope("session", new SessionScope());
		((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope("request", new RequestScope());
	}

	/**
	 * Returns a mock HttpServletRequest object.
	 *
	 */
	private MockHttpServletRequest getMockHttpServletRequest() {
		MockHttpServletRequest request = new MockHttpServletRequest();
		ServletRequestAttributes attributes = new ServletRequestAttributes(request);
		RequestContextHolder.setRequestAttributes(attributes);
		return request;
	}

	/**
	 * Returns a mock HttpServletResponse object.
	 *
	 */
	private MockHttpServletResponse getMockHttpServletResponse() {
		return new MockHttpServletResponse();
	}
}